Python 分析apache log脚本

为了统计每个IP的访问次数,偿试着写了一个python脚本,得到前10个访问次数最多的IP: def countstatics(result): “””Compute the statics.””” li = result.split(‘\n’) l = {} for a in set(li): l[a] = 0 for a in li: l[a] = l[a] + 1 print “The uniq ip number is “, len(l) return l def apachelog(path): … Continue reading Python 分析apache log脚本